<h1>Listing users</h1>

<table>
  <tr>
    <th>User type</th>
    <th>First name</th>
    <th>Last name</th>
    <th>Email</th>
    <th>Password digest</th>
    <th>Index phone</th>
    <th>Phone</th>
    <th>Address</th>
    <th>Country</th>
    <th>City</th>
    <th>Zip code</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @users.each do |user| %>
  <tr>
    <td><%= user.user_type_id %></td>
    <td><%= user.first_name %></td>
    <td><%= user.last_name %></td>
    <td><%= user.email %></td>
    <td><%= user.password_digest %></td>
    <td><%= user.index_phone %></td>
    <td><%= user.phone %></td>
    <td><%= user.address %></td>
    <td><%= user.country %></td>
    <td><%= user.city %></td>
    <td><%= user.zip_code %></td>
    <td><%= link_to 'Show', user %></td>
    <td><%= link_to 'Edit', edit_user_path(user) %></td>
    <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New User', new_user_path %>
